'''
/*
 * @Author: wevsmy 
 * @Date: 2017-10-24 19:16:33 
 * @Last Modified by: wevsmy
 * @Last Modified time: 2017-10-25 14:52:54
 */
'''
#codfig=utf-8
#导入socket
from socket import *
def main():
    #创建socket
    udpSocket = socket(AF_INET,SOCK_DGRAM)
    newIp = input("请输入目的Ip:")
    newPort = int(input("请输入目的Port:"))
    newStr = input("请输入要发送的数据：")
    #发送数据
    udpSocket.sendto(newStr.encode("gb2312"),(newIp,newPort))

if __name__ == '__main__':
    main()
    